﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Helpers;
namespace GPMS.Model
{
    public class RemoteCustom : ValidationAttribute
    {
        public string Action { get; set; }
        public string Controller { get; set; }
        /// <summary>
        /// 验证实体唯一性,仅提供远程验证规则,无实体验证
        /// </summary>
        /// <param name="action"></param>
        /// <param name="controller"></param>
        public RemoteCustom(string action,string controller):base("唯一的")
        {
            this.Action = action;
            this.Controller = controller;   
        }
        

        public override bool IsValid(object value)
        {
            if (value == null)
            {
                return true;
            }
            return true;
        }
    }
}
